package com.ktjy.test;

import com.ktjy.entity.Player;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    @Test
    public void test() {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        Player player = (Player) context.getBean("zhangsan");
        System.out.println("装备名称："+player.getArmet().getName()+" 装备类型："+player.getArmet().getType()+" 攻击效率："+player.getArmet().getAttackPlus()
        +" 防御效率:"+player.getArmet().getDefencePlus()+" 速度效率："+player.getArmet().getSpeedPlus());
    }
    @Test
    public void test1() {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        Player player = (Player) context.getBean("zhangsan");
        System.out.println("装备名称："+player.getRing().getName()+" 装备类型："+player.getRing().getType()+" 攻击效率："+player.getRing().getAttackPlus()
                +" 防御效率:"+player.getRing().getDefencePlus()+" 速度效率："+player.getRing().getSpeedPlus());
    }
}
